package com.lantosec.hmrp.modules.internal.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.util.Date;

import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.internal.vo.InternalPlanVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 评价方案 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-04-23
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class InternalPlan extends BaseEntity<InternalPlanVO> {

    private static final long serialVersionUID = 1L;
    public InternalPlan(InternalPlanVO vo){
        this.internalPlanId = vo.getInternalPlanId();
        this.internalPlanName = vo.getInternalPlanName();
        this.internalPlanType = vo.getInternalPlanType();
        this.internalPlanCycle = vo.getInternalPlanCycle();
        this.startDate = vo.getStartDate();
        this.endDate = vo.getEndDate();
        this.executorMode = vo.getExecutorMode();
        this.targetMode = vo.getTargetMode();
        this.state = vo.getState();
        this.delay = vo.getDelay();
        this.managerPost = vo.getManagerPost();
        this.createUserId = vo.getCreateUserId();
        this.createUser = vo.getCreateUser();
        this.createTime = vo.getCreateTime();
        this.editorUserId = vo.getEditorUserId();
        this.editorUser = vo.getEditorUser();
        this.editorTime = vo.getEditorTime();
    }

    @Override
    public InternalPlanVO convertToVO(){
        return new InternalPlanVO(this);
    }


    /**
     * 评价方案ID
     */
    @TableId(value = "internal_plan_id", type = IdType.AUTO)
    private Integer internalPlanId;

    /**
     * 评价方案名称
     */
    private String internalPlanName;

    /**
     * 评价方案类型(1科间互评 2科内互评 3评上级领导 4自定义)
     */
    private Integer internalPlanType;

    /**
     * 方案周期(0临时 2周 3月 4季度 5年)
     */
    private Integer internalPlanCycle;

    /**
     * 方案开始日期
     */
    private String startDate;

    /**
     * 方案结束日期
     */
    private String endDate;

    /**
     * 评价方形式(1科室 2岗位 3人员)
     */
    private Integer executorMode;

    /**
     * 被评价方形式(1科室 2岗位 3人员)
     */
    private Integer targetMode;

    /**
     * 方案状态(1暂停 2启用 3到期 4作废)
     */
    private Integer state;

    /**
     * 允许延期(工作日)
     */
    private Integer delay;

    /**
     * 管理岗是否参评(type=3时可选)
     */
    private Integer managerPost;

    /**
     * 创建人ID
     */
    private String createUserId;

    /**
     * 创建人
     */
    private String createUser;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 最后编辑人ID
     */
    private String editorUserId;

    /**
     * 最后编辑人
     */
    private String editorUser;

    /**
     * 最后编辑时间
     */
    private Date editorTime;


    public enum ColName {
        internal_plan_id, internal_plan_name, internal_plan_type, internal_plan_cycle, start_date, end_date, executor_mode, target_mode, state, delay, manager_post, create_user_id, create_user, create_time, editor_user_id, editor_user, editor_time,
    }
}
